package com.ruoyi.project.seeDoctor.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.seeDoctor.domain.MedPati;
import com.ruoyi.project.seeDoctor.domain.SysDepts;
import com.ruoyi.project.seeDoctor.service.IRegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/seeDoctor/register")
public class RegisterController extends BaseController {
    @Autowired
    private IRegisterService iRegisterService;
    //查询科室信息
    @PreAuthorize("@ss.hasPermi('seeDoctor:register:list')")
    @GetMapping("/list")
    public TableDataInfo list(String depts_name)
    {
        startPage();
        List<SysDepts> sysDepts = iRegisterService.selSysDeptsService(depts_name);
        return getDataTable(sysDepts);
    }
    //查询患者信息
    @PreAuthorize("@ss.hasPermi('seeDoctor:register:selMedPatiByCode')")
    @GetMapping("pati_code")
    public AjaxResult selMedPatiByCode( String pati_code)
    {
        return AjaxResult.success(iRegisterService.selMedPatiByCodeService(pati_code));
    }

}
